<template>
	<view class="u-page">
		<u-row customStyle="padding: 10px">
			<u-col span="12">
				<u--text size="20" text="项目列表"></u--text>
				
				<u-list @scrolltolower="scrolltolower">
					<u-list-item v-for="(item, index) in project.list" :key="index">
						<u-cell :title="item.name" :label="(item.cost)/100+'元/张'" :isLink="true" 
						:url="'/pages/index/detail?projectId='+item.id">
							<u-avatar slot="icon" shape="square" size="35" :src="item.logo"></u-avatar>
						</u-cell>
					</u-list-item>
				</u-list>
			</u-col>
		</u-row>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				project: {
					list:[],
					count:0
				}
			}
		},
		onLoad() {
			// uni.setStorageSync('openid','oHhwJ56V8OxbUXlFE8eUrwjCXcXs');
			// uni.setStorageSync('auth','d84ed75b-1ef7-456c-a271-87e0c843b17f');
			this.getProject();
		},
		methods: {
			getProject(){
				const that=this;
				uni.$u.http.post('/api/tools.Project/getProject',{}).then(data=> {
					that.project.list=data.result.list;
					console.log(data.result.list);
				});
			}
		}
	}
</script>

<style>
</style>
